Only suppress warnings in Vite dev mode and on client #82
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We can't use this package unless this fix gets merged.
As I commented,
suppressWarnings
currently kills our node server, which is pretty wild, because it only gets "uninstrumented" on the client, so theconsole.warn
call stack just grows and grows.This is an improvement to the currently open PR #63.
The warnings are only logged in dev mode, so we can leave
console.warn
alone if we know that we're not in dev mode.And we certainly don't want to touch globals in node/on the server.
I did my best to determine dev mode and client without assuming we're running in a Vite app.
If the code is not running in a Vite app, then we can't detect dev mode, so it will behave the same in the browser as it did before.
Except that I made the filter a bit smarter, so that it should only suppress warnings that are actually caused by markdown renderers.